package com.ruoyi.shop.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.shop.mapper.ShopProductsMapper;
import com.ruoyi.shop.domain.ShopProducts;
import com.ruoyi.shop.service.IShopProductsService;

/**
 * 商品Service业务层处理
 * 
 * @author liuwp
 * @date 2025-11-24
 */
@Service
public class ShopProductsServiceImpl implements IShopProductsService 
{
    @Autowired
    private ShopProductsMapper shopProductsMapper;

    /**
     * 查询商品
     * 
     * @param id 商品主键
     * @return 商品
     */
    @Override
    public ShopProducts selectShopProductsById(Long id)
    {
        return shopProductsMapper.selectShopProductsById(id);
    }

    /**
     * 查询商品列表
     * 
     * @param shopProducts 商品
     * @return 商品
     */
    @Override
    public List<ShopProducts> selectShopProductsList(ShopProducts shopProducts)
    {
        return shopProductsMapper.selectShopProductsList(shopProducts);
    }

    /**
     * 根据业务主键查询一条记录：商品
     *
     * @param shopProducts 商品
     * @return 商品
     */
    @Override
    public ShopProducts selectOneShopProducts(ShopProducts shopProducts)
    {
        return shopProductsMapper.selectOneShopProducts(shopProducts);
    }

    /**
     * 新增商品
     * 
     * @param shopProducts 商品
     * @return 结果
     */
    @Override
    public int insertShopProducts(ShopProducts shopProducts)
    {
        return shopProductsMapper.insertShopProducts(shopProducts);
    }

    /**
     * 修改商品
     * 
     * @param shopProducts 商品
     * @return 结果
     */
    @Override
    public int updateShopProducts(ShopProducts shopProducts)
    {
        return shopProductsMapper.updateShopProducts(shopProducts);
    }

    @Override
    public int updateShopProductsCondition(ShopProducts shopProducts, ShopProducts shopProductsCondition)
    {
        return shopProductsMapper.updateShopProductsCondition(shopProducts, shopProductsCondition);
    }

    /**
     * 批量删除商品
     * 
     * @param ids 需要删除的商品主键
     * @return 结果
     */
    @Override
    public int deleteShopProductsByIds(Long[] ids)
    {
        return shopProductsMapper.deleteShopProductsByIds(ids);
    }

    /**
     * 删除商品信息
     * 
     * @param id 商品主键
     * @return 结果
     */
    @Override
    public int deleteShopProductsById(Long id)
    {
        return shopProductsMapper.deleteShopProductsById(id);
    }

    /**
     * 条件删除商品
     *
     * @param shopProducts 商品
     * @return 结果
     */
    @Override
    public int deleteShopProductsByCondition(ShopProducts shopProducts)
    {
        return shopProductsMapper.deleteShopProductsByCondition(shopProducts);
    }

}
